package com.ztl.friendship;

import com.ztl.friendship.config.RedissonConfig;
import com.ztl.friendship.netty.ChatNettyWebSocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableConfigurationProperties(RedissonConfig.class)
@MapperScan("com.ztl.friendship.mapper")
@ServletComponentScan()
@EnableAsync
public class FriendshipApplication {

    public static void main(String[] args) {
        SpringApplication.run(FriendshipApplication.class, args);

        // 启动Netty服务器
        ChatNettyWebSocketServer nettyServer = new ChatNettyWebSocketServer();
        nettyServer.run();
    }

}
